// import audio from '@blueos.media.audio.audioPlayer'
import media from '@blueos.media.audio.mediaManager'

let rockingAudio;
let showAudioPlayer;
export const initAudio = () => {
  rockingAudio = media.createAudioPlayer({streamUsage: 'music' })
  showAudioPlayer = media.createAudioPlayer({streamUsage: 'ring'})
  rockingAudio.src = "/assets/audio/rocking.mp3"
  showAudioPlayer.src = "/assets/audio/show.mp3"
  rockingAudio.playcount = -1
}

export const releaseAudio = () => {
  rockingAudio.release()
  showAudioPlayer.release()
}

export const sakeingAudio = () => {
  rockingAudio.play()
}

export const stopSakeingAudio = () => {
  rockingAudio.pause()
}

export const showAudio = () => {
  showAudioPlayer.play()
} 